//
//  Labs_Runtime_Swift_DemoVC.swift
//  APSwift
//
//  Created by jianbo.pei on 2023/9/22.
//

import UIKit

class Labs_Runtime_Swift_DemoVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        view.backgroundColor = .white
        test()
    }
    
    func test(){
        var methodCount: UInt32 = 0
        let methodlist = class_copyMethodList(LRS_Animal.self, &methodCount)
        for i in 0..<numericCast(methodCount) {
            if let method = methodlist?[i]{
                let methodName = method_getName(method);
                print("⽅法列表:\(String(describing: methodName))")
            } else {
                print("not found method");
            }
        }

        var count: UInt32 = 0
        let proList = class_copyPropertyList(Animal.self, &count)
        for i in 0..<numericCast(count) {
            if let property = proList?[i]{
                let propertyName = property_getName(property);
                print("属性成员属性:\(String(utf8String: propertyName)!)")
            } else {
                print("没有找到你要的属性");
            }
        }
        print("调用这个方法")
    }

}
